package com.tdk.demo.service.impl;

import com.tdk.dao.BaseDao;
import com.tdk.demo.entities.User;
import com.tdk.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DemoServiceImpl implements DemoService {

	@Autowired
	private BaseDao dao;

    @Override
    public User updateState(Integer id) {
		User user = new User();
		user.setId(116);
		user.setName("张三bbb");
		dao.update(user);
		// updateBySql事务不起作用
//		dao.updateBySql("update User set name='aaa' where id=116");
        int a =1/0;
        return user;
    }

}
